<%--
<!------------------------------------------------------------------------------
 - Copyright 2005 CORE Solutions Limited
 - All rights reserved.
 - PROPRIETARY AND CONFIDENTIAL INFORMATION.
 - Use is subject to license terms.
 -
 - FUNCTION ID      :   SYS_LANG
 - AUTHOR           :   Victor Zheng 
 - DATE CREATE      :   2005/12/21
 - DESCRIPTION      :   a PAGE-EDIT CONTENT JSP file for the function, SYS_LANG
 -                  :   
 -                  :   
 -                  :   
 -
 - MODIFICATION HISTORY:
 - DATE         AUTHOR          VERSION NO.         COMMENT
 - -----------  --------------  ------------------  -------------------
 - 2005/12/21   Victor Zheng    1.0                 source is generated.
 -
 -
 -
------------------------------------------------------------------------------->

--%>
<%@ include file="/jsp/com/erp/app/common/jsp/directives_include.jsp"%>

<%@ page  import="com.erp.app.admin.sysLang.web.SysLangAction" %>
<%@ page  import="com.erp.app.admin.sysLang.web.SysLangRow" %>

<%@ include file="/jsp/com/erp/app/common/jsp/html_include.jsp"%>

<jsp:useBean id="sysLangForm" scope="session" type="com.erp.app.admin.sysLang.web.SysLangForm" />

<%
ArrayList sysLangList = sysLangForm.getMultiRows();
pageContext.setAttribute("sysLangList", sysLangList);
rowReadOnly = false;
TableSchema ts = sysLangForm.getTs();
%>

<script language="javascript">

	function doLoad() {
		<%
		if (CommonUtil.nullToString((String)session.getAttribute(ProjectConstants.SESSION_ALERT_AFTER_SAVE)).equals(ProjectConstants.GENERIC_YES)) {
			session.removeAttribute(ProjectConstants.SESSION_ALERT_AFTER_SAVE);
			out.println("alert('Records saved.');");
		}
		%>
	}

</script>

<body onLoad="javascript:doLoad();autofill_init();">
<html:form action="/sysLang">

<html:hidden property="pageEvent"/>
<html:hidden property="pageMode"/>
<html:hidden property="deleteIdx"/>
<html:hidden property="pageEventSrc"/>

<table class="table_top">

<tr>
	<td>
		<chtml:button form="sysLangForm" pageEvent="<%=SysLangAction.ACTION_EXIT%>"
			styleClass="button1"/>
		<chtml:button form="sysLangForm" pageEvent="<%=SysLangAction.ACTION_SEARCH%>"
			styleClass="button1"/>
		<chtml:button form="sysLangForm" pageEvent="<%=SysLangAction.ACTION_CLEAR%>"
			styleClass="button1"/>		
		<%--<chtml:button form="sysLangForm" pageEvent="<%=SysLangAction.ACTION_COPY_ROW%>"
			styleClass="button1"/>--%>
		<chtml:button form="sysLangForm" pageEvent="<%=SysLangAction.ACTION_SAVE%>"
			styleClass="button1"/>
		<chtml:button form="sysLangForm" pageEvent="<%=SysLangAction.ACTION_REFRESH%>"
			styleClass="button1"/>
		<!--Print in English or Chinese? Uncomment where appropriate.
		<chtml:button form="sysLangForm" pageEvent="<%=SysLangAction.ACTION_PRINT%>"
			styleClass="button1"/>-->
		<!--<chtml:button form="sysLangForm" pageEvent="<%=SysLangAction.ACTION_PRINT_ENG%>"
			styleClass="button1"/>-->
		<!--<chtml:button form="sysLangForm" pageEvent="<%=SysLangAction.ACTION_PRINT_CHN%>"
			styleClass="button1"/>-->
	</td>
</tr>

<tr>
	<td>

		<table class="table_crit">

		<tr class="col_label"> 
			<td class="col_label">&nbsp;</td>
			<td class="col_label_fr_to">
				<%
				webLabel = ts.getDisplayWebLabelByObjectId("LBL_SRCH_FROM");
				%>
				<%=webLabel%>
			</td>
			<td class="col_label_fr_to">
				<%
				webLabel = ts.getDisplayWebLabelByObjectId("LBL_SRCH_TO");
				%>
				<%=webLabel%>
			</td>
		</tr>
		<tr>
			<%
			webLabel = ts.getDisplayWebLabelByObjectId("LBL_SRCH_LANG_CODE");
			%>
			<td class="col_label">
			*<%=webLabel%>
			</td>
			<td class="col_value">
				<html:text property="srchLangCodeFr" styleClass="textbox1" maxlength="<%=srchColSize%>" size="<%=srchDisplaySize%>"/>
			</td>
			<td class="col_value">
				<html:text property="srchLangCodeTo" styleClass="textbox1" maxlength="<%=srchColSize%>" size="<%=srchDisplaySize%>"/>
			</td>
		</tr>
		<tr>
			<%
			webLabel = ts.getDisplayWebLabelByObjectId("LBL_SRCH_LANG_NAME");
			%>
			<td class="col_label">
			*<%=webLabel%>
			</td>
			<td class="col_value">
				<html:text property="srchLangNameFr" styleClass="textbox1" maxlength="<%=srchColSize%>" size="<%=srchDisplaySize%>"/>
			</td>
			<td class="col_value">
				<html:text property="srchLangNameTo" styleClass="textbox1" maxlength="<%=srchColSize%>" size="<%=srchDisplaySize%>"/>
			</td>
		</tr>
		<tr>
			<%
			webLabel = ts.getDisplayWebLabelByObjectId("LBL_SRCH_ORDER_SEQ");
			%>
			<td class="col_label">
			*<%=webLabel%>
			</td>
			<td class="col_value">
				<html:text property="srchOrderSeqFr" styleClass="textbox1" maxlength="<%=srchColSize%>" size="<%=srchDisplaySize%>"/>
			</td>
			<td class="col_value">
				<html:text property="srchOrderSeqTo" styleClass="textbox1" maxlength="<%=srchColSize%>" size="<%=srchDisplaySize%>"/>
			</td>
		</tr>

		</table>

	</td>
</tr>

<tr>
	<td><font color='red'><html:errors/></font></td>
</tr>

<tr>
	<td>
	<%if(sysLangForm.getTotalPage() == 0 ) { %>
		&nbsp;
	<%} else { %>
		Page <%=sysLangForm.getCurrentPage()%> of <%=sysLangForm.getTotalPage()%>
	<%} %>
		<input type="button" value="&lt;&lt;" class="button1" onClick="javascript:doSubmit('<%=sysLangForm.ACTION_SCROLL_LEFT%>');" <%=sysLangForm.getSidx() == 0 ? "disabled" : ""%>>
		<input type="button" value="&gt;&gt;" class="button1" onClick="javascript:doSubmit('<%=sysLangForm.ACTION_SCROLL_RIGHT%>');" <%=sysLangForm.getSidx() < Integer.parseInt(sysLangForm.getLastPageSidx()) ? "" : "disabled"%>>
	</td>
</tr>

</table>


<table class="table_grid">

	<tr class="grid_header">
		<%
			webLabel = ts.getDisplayWebLabelByObjectId("LBL_GRID_DELETE");
		%>
		<td class="grid_header_col_narrow" nowrap>
			<%=webLabel%>
		</td> 
		<%
			webLabel = ts.getDisplayWebLabelByObjectId("LBL_GRID_LANG_CODE");
		%>
		<td class="grid_header_col" nowrap>
			*<%=webLabel%>
		</td>
		<%
			webLabel = ts.getDisplayWebLabelByObjectId("LBL_GRID_LANG_NAME");
		%>
		<td class="grid_header_col" nowrap>
			<%=webLabel%>
		</td>
		<%
			webLabel = ts.getDisplayWebLabelByObjectId("LBL_GRID_ORDER_SEQ");
		%>
		<td class="grid_header_col" nowrap>
			<%=webLabel%>
		</td>
	</tr>

	<logic:iterate id="sysLangRow" name="sysLangList" indexId="idx" length="<%=String.valueOf(ProjectConstants.MAX_DISPLAY)%>" offset="<%=String.valueOf(sysLangForm.getSidx())%>">

	<%
		SysLangRow row = (SysLangRow) sysLangRow;
	%>

	<% if(row != null) {%>

	<tr <%=(idx.intValue()%2 == 0)? "class='grid_result1'": "class='grid_result2'"%>>		
		<td nowrap>
		<chtml:button form="sysLangForm" deleteButton="true" multiRow="sysLangRow" pageEvent="<%=SysLangAction.ACTION_DELETE_ROW%>" pageEventSrc="<%=String.valueOf(idx)%>" styleClass="button1" disabled="<%=String.valueOf(rowReadOnly)%>"/>
		<%--<html:checkbox property="isDelete" name="sysLangRow" value="on" styleClass="checkbox1" disabled="<%=rowReadOnly%>" />
			
			<input type=\"checkbox\" name=\"isDelete\" value=\"\" class=checkbox1 <%=rowReadOnly ? "disabled=\"true\"" : ""%> >
			--%>
		</td>
		<td nowrap>
			<%
			colSize = String.valueOf(ts.getColSizeByObjectId("LBL_GRID_LANG_CODE"));
			displaySize = String.valueOf(ts.getDisplaySizeByObjectId("LBL_GRID_LANG_CODE"));
			%>
			<logic:equal name="sysLangRow" property="rowMode" value="<%=ProjectConstants.ROW_MODE_CREATE%>">
				<html:text property="langCode" styleClass="textbox1" readonly="<%=rowReadOnly%>" size="<%=colSize%>" maxlength="<%=displaySize%>" value="<%=CommonUtil.nullToString(row.getLangCode())%>"/>
			</logic:equal>
			<logic:notEqual name="sysLangRow" property="rowMode" value="<%=ProjectConstants.ROW_MODE_CREATE%>">
				<bean:write name="sysLangRow" property="langCode" filter="true"/>
				<html:hidden property="langCode" value="<%=CommonUtil.nullToString(row.getLangCode())%>"/>
			</logic:notEqual>
		</td>
		<td nowrap>
			<%
			colSize = String.valueOf(ts.getColSizeByObjectId("LBL_GRID_LANG_NAME"));
			displaySize = String.valueOf(ts.getDisplaySizeByObjectId("LBL_GRID_LANG_NAME"));
			%>
			<html:text property="langName" styleClass="textbox1" readonly="<%=rowReadOnly%>" size="<%=colSize%>" maxlength="<%=displaySize%>" value="<%=CommonUtil.nullToString(row.getLangName())%>"/>
		</td>
		<td nowrap>
			<%
			colSize = String.valueOf(ts.getColSizeByObjectId("LBL_GRID_ORDER_SEQ"));
			displaySize = String.valueOf(ts.getDisplaySizeByObjectId("LBL_GRID_ORDER_SEQ"));
			%>
			<html:text property="orderSeq" styleClass="textbox1" readonly="<%=rowReadOnly%>" size="<%=colSize%>" maxlength="<%=displaySize%>" value="<%=CommonUtil.nullToString(row.getOrderSeq())%>"/>
		</td>
	</tr>

	<% } // end if(row != null) %>

	<html:hidden property="idx" value="<%=row.getIdx()%>" />
	<html:hidden property="rowMode"  value="<%=row.getRowMode()%>"/>

	</logic:iterate>

</table>
<div class="footerbuttons">
	<chtml:button form="sysLangForm" pageEvent="<%=SysLangAction.ACTION_ADD_ROW%>"
			styleClass="button1"/>
</div>
</html:form>
